package com.gameserver.models;

import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name="Game")
public abstract class Game extends BaseModel{
	public enum GameType{
		BATTLESHIP;
	}
	
	public enum GameStatus{
		NEW, WAITING, STARTED, FINISHED;
	}
	
	protected GameType gameType;
	protected GameStatus gameStatus;
	protected String gameId;
	
	public Game(GameType type){
		this.gameType = type;
		this.gameStatus = GameStatus.NEW;
		this.gameId = generateId();
	}
	
	private String generateId(){
		//will be more sophisticated later on
		return System.currentTimeMillis() + "-Battleship";
	}
	
	
	public GameType getGameType() {
		return gameType;
	}
	public void setGameType(GameType gameType) {
		this.gameType = gameType;
	}
	public GameStatus getGameStatus() {
		return gameStatus;
	}
	public void setGameStatus(GameStatus gameStatus) {
		this.gameStatus = gameStatus;
	}
	
	public String getGameId() {
		return gameId;
	}
	
}
